package com.cn.io.bio;

import java.io.*;

public class ReaderIo {


    public static void main(String[] args) throws IOException {
        Reader reader = null;
        Writer writer = null;
        try {
            reader = new BufferedReader(new FileReader("D:\\opt\\def.txt"));
            writer = new BufferedWriter(new FileWriter("D:\\opt\\abc.txt"));
            char[] bytes = new char[1024];
            while (reader.read(bytes) != -1) {
                writer.write(bytes);
            }
            writer.flush();
        } catch (IOException e) {

        } finally {
            if (reader != null) {
                reader.close();
            }
            if (writer != null) {
                writer.close();
            }
        }

    }
}
